<template>
    <div>
        <mt-swipe :auto="4000" >
        <mt-swipe-item v-for="item in lunbotuList" :key="item.id">
        <img class="swipe" :src="item.img"/>
        </mt-swipe-item>
        </mt-swipe>
        <!-- 九宫格到六宫格的 改造工程-->
                <ul class="mui-table-view mui-grid-view mui-grid-9">
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
                            <router-link to="/home/newslist">
                            <img src="../../images/menu/menu1.png" alt="">
		                    <div class="mui-media-body">新闻资讯</div>
                            </router-link>
                            </li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
                            <router-link to="/home/photolist">
		                     <img src="../../images/menu/menu2.png" alt="">
		                    <div class="mui-media-body">图片分享</div>
                            </router-link>
                            </li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
                            <router-link to="/home/goodslist">
		                     <img src="../../images/menu/menu3.png" alt="">
		                    <div class="mui-media-body">商品购买</div>
                            </router-link>
                    </li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><a href="#">
		                     <img src="../../images/menu/menu4.png" alt="">
		                    <div class="mui-media-body">留言反馈</div></a></li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><a href="#">
		                     <img src="../../images/menu/menu5.png" alt="">
		                    <div class="mui-media-body">视频专区</div></a></li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><a href="#">
		                     <img src="../../images/menu/menu6.png" alt="">
		                    <div class="mui-media-body">联系我们</div></a></li>
		        </ul> 

    </div>
</template>

<script>
import { Toast } from "mint-ui";
export default {
  data(){
      return{
          lunbotuList:[]
      }
  },
  methods: {
      getSwipe1(){//获取轮播图数据的方法
        //通过get请求获取数据
        this.lunbotuList = [{"id":1,
              "img":"/src/images/swipe/t1.jpg"
          },{"id":2,
              "img":"/src/images/swipe/t2.jpg"
          },{"id":3,
              "img":"/src/images/swipe/t3.jpg"
          }]
      },
getSwipe(){//获取轮播图数据的方法

        this.$http.get('api/swipe/getList').then(result => {
         var result = result.body
         console.log(result);
        if(result.code === 200){
            this.lunbotuList = result.datas;
            }else{
           Toast("轮播图加载失败")
            }
      })
    }
  },
  created() {
      this.getSwipe()
  }
}
</script>

<style lang="scss" scoped>
.mint-swipe {
    height: 400px;
    img {
    height: 100%;
    width: 100%;
}
}

.mui-grid-view.mui-grid-9 {
    background-color: #fff;
    border: none;
    img {
        height: 60px;
        width: 60px;
    }
    .mui-media-body{
    font-size: 13px;
    }
}

.mui-grid-view.mui-grid-9 .mui-table-view-cell{
    border: 0;
}


</style>